package com.qk.management.mapper;

import com.qk.domain.user.UserDO;
import com.qk.dto.user.UserDTO;
import com.qk.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface UserMapper  {

    @Select("select u.* from user u left join  role r on u.role_id=r.id where r.label=#{roleLabel} ")
    List<User> selectByLabel(String roleLabel);
    List<UserDO> selectByPage(UserDTO dto);

    void insert(User user);



@Select("select * from user where id= #{id}")
    User selectById(Integer id);

    void update(User user);

    @Select("select * from user")
    List<User> listAll();


    void deleteByIds(List<Integer> ids);

    @Select("select * from user where username= #{username}")
    User selectByUsername(String username);
}
